//
//  ViewController.swift
//  CustomSegmentView
//
//  Created by haisheng huang on 15/11/14.
//  Copyright © 2015年 haisheng huang. All rights reserved.
//

import UIKit

class ViewController: UIViewController, SegmentViewDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        self.title = "segmentView"
        
        let frame: CGRect = CGRectMake(0.0, 64.0, self.view.frame.size.width, 44.0)
        let segmentView: SegmentView = SegmentView(frame: frame, titles: ["第一项", "第二项", "第三项"], icons: nil, style: nil)
        //segmentView.sStyle = nil
        segmentView.delegate = self
        self.view.addSubview(segmentView)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func segmentView(segmentView: SegmentView, didSelectedItemAtIndex index: Int) {
        print("index: \(index)")
    }
    
}

